<!DOCTYPE html>
<html>
<head>
    <title>支付 | 在线充值</title>
<include file="Public/head"/>

</head>
<body>
    <div id="wrapper">
<include file="Public/leftmenu"/>
        <div id="page-wrapper" class="gray-bg">
	 <include file="Public/top"/>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>线上收款</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a>Member</a>
                        </li>
                
                        <li class="active">
                            <strong>充值消费</strong>
                        </li>
                    </ol>
                </div>
                <div class="col-lg-2">

                </div>
            </div>
       	 	<div class="wrapper wrapper-content animated fadeIn">
            	<div class="row">
                	<div class="col-lg-6">
                	    <div class="tabs-container weixin">
                	    <!-- <ul class="nav nav-tabs">
                	            <li class="active"><a data-toggle="tab" href="#tab-1">充值</a></li>
                	            <li class=""><a data-toggle="tab" href="#tab-2">消费</a></li>
                	        </ul> -->
                	        <div class="tab-content">
                	            <div id="tab-1" class="tab-pane active">
                	                <div class="panel-body">
                	                    <div class="row">
                            				<div class="col-sm-12 micropay">
                                                <h3 class="m-t-none m-b">充值</h3>
                                                <p>要确认好充值信息哦(⊙o⊙)</p>

											<form role="form" action="?s=Member/recharge" id="form1">
												<input type="hidden" name="cid" value="{$id}" />
                                                <input type="hidden" name="e_type" value="0" />
                                                <input type="hidden" name="paytype" value="1" />
											    <div class="form-group" >
                                                    <label>持卡人</label>
                                                    <input  type="text" placeholder="持卡人" value="{$name}"  disabled class="form-control">
                                                </div>
											    <div class="form-group" >
                                                    <label>会员手机号</label>
                                                    <input  type="text" placeholder="手机号" value="{$mobile}"  disabled class="form-control">
                                                </div>
                                                <div class="form-group">
                                                    <label>支付金额</label>
                                                    <input  onkeyup="this.value=this.value.replace(/\D/g,'')"  type="text" placeholder="支付金额" name="money" class="form-control">
                                                </div>
                                                <div class="form-group">
                                                    <label>赠送金额</label>
                                                    <input  onkeyup="this.value=this.value.replace(/\D/g,'')"  type="text" placeholder="赠送金额" name="giving" class="form-control">
                                                </div>
                                                <div class="form-group">
                                                    <label>赠送积分</label>
                                                    <input onkeyup="this.value=this.value.replace(/\D/g,'')"  type="text" placeholder="赠送积分(选填)" name="e_point" class="form-control">
                                                </div>
                                                <div class="form-group">
                                                    <label>充值备注</label>
                                                    <input type="text" placeholder="充值备注(选填)" name="note" class="form-control">
                                                </div>
                                                <div>
                                                    <button  onclick="return checkc('form1');" class="btn btn-sm btn-primary pull-right m-t-n-xs" type="button" >
                                                        <strong>在线充值</strong>
                                                    </button>
                                                </div>
                                            </form>
                                        </div>
                        				</div>
                	                </div>
                	            </div>
                	    </div>
                	</div>
            	</div>
        	</div>
	<include file="Public/footer"/>
        </div>
    </div>
	
	<script>
	    function cphone(d,id){
           	var pattern = /^1[34578]\d{9}$/;
		
			if (pattern.test(d.value)) {
            
					$.post('?s=Member/getCard',{mobile:d.value}, function(data){
						$("#"+id).html('');
					  $("#"+id).html(data);
					 
					});
		
				return true;
			}else{
				
							swal("错误", "手机号没输入对哦 :)", "error");return false;
			}
		}
	    function checkc(d){
		   var c = $("#"+d);
    			swal({
				title: "提示 :)",
        			text: "确认此操作？",
        			type: "warning",
        			showCancelButton: true,
        			confirmButtonColor: "#DD6B55",
        			confirmButtonText: "确定",
					cancelButtonText: "取消",
        			closeOnConfirm: false
    			}, function () {
				  
    			    var e = c.serialize();	
					$.post(c.attr('action'),e, function(data){
						console.log(data);
						if(data.error == 0){
							
							swal("成功!", data.msg, "success");
							window.location.href = "{:U('Member/lists')}";
						}else{
							swal("失败!", data.msg, "error");
							//window.history.back(-1)
							// $("#"+d).reset(); 
						}
					},'JSON');
    			});
			}

	</script>

</body>
</html>